extends Node

const KEYCODE_SETTINGS = "设置开关"
const KEYCODE_WARP = "换行"
const KEYCODE_ENTER = "发送"
const KEYCODE_AMPLIFY = "地图放大"
const KEYCODE_REDUCE = "地图缩小"
const KEYCODE_UP = "地图上移"
const KEYCODE_DOWM = "地图下移"
const KEYCODE_LEFT = "地图左移"
const KEYCODE_RIGHT = "地图右移"
const KEYCODE_CENTER = "地图居中"
const KEYCODE_WU = "地图编辑-无"
const KEYCODE_KONG = "地图编辑-空"
const KEYCODE_SHAN = "地图编辑-山"
const KEYCODE_SHUI = "地图编辑-水"
const KEYCODE_LIN = "地图编辑-林"
const KEYCODE_SHA = "地图编辑-沙"
const KEYCODE_JING = "地图编辑-晶"



var all_keyboardKeys:Dictionary = {}

# 更新键盘按键状态，如果有变化返回true
func update_keyState(key:String):
	var state = Input.get_action_strength(key)
	if(all_keyboardKeys.get(key) != state):
		all_keyboardKeys.merge({key:state},true)
		return true
	return false
	
func get_keyState(key:String):
	return all_keyboardKeys.get(key)
	
# 点击直接用这个比较好
func is_click(key:String):
	if update_keyState(key) :
		return get_keyState(key) == 1
	else:
		return false
